﻿using System;
using System.Linq;

namespace Basmus.Resources
{
    public class VirtualPathAttributeService : IVirtualPathService
    {
        public string Resolve(Type type)
        {
            var attribute = type
                .GetCustomAttributes(typeof (FullPathAttribute), false)
                .Cast<FullPathAttribute>()
                .FirstOrDefault();
            if (attribute == null)
                return null;
            return attribute.Path;

        }
    }
}